define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
    return {
        index: function () {
            Table.api.init({
                extend: {
                    index_url: 'vv/account/index' + location.search,
                    add_url  : '',
                    edit_url : '',
                    del_url  : '',
                    multi_url: '',
                    table    : ''
                }
            });
            const table = $("#table")
            table.bootstrapTable({
                url    : $.fn.bootstrapTable.defaults.extend.index_url,
                pk     : 'id',
                columns: [
                    [
                        {checkbox: true},
                        {field: 'id', title: 'ID'},
                        {field: 'bankName', title: '银行/第三方', operate: 'LIKE'},
                        {field: 'cardCode', title: '账户/账号', operate: 'LIKE'},
                        {field: 'username', title: '持卡人姓名', operate: 'LIKE'},
                        {field: 'mobile', title: '手机号', operate: 'LIKE'},
                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                    ]
                ]
            })
            Table.api.bindevent(table)
        },
        add  : function () {
            Form.api.bindevent($("form[role=form]"))
        },
        edit : function () {
            Form.api.bindevent($("form[role=form]"))
        }
    }
})